﻿using ServerFrame;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Gameserver
{
    /// <summary>
    /// 广播处理，给对应的token（客户端）分发命令（传输模型）；最后调用AbsOnceHandler，进行分发
    /// </summary>
    public class AbsBroadcastHandler:AbsOnceHandler
    {
        public void Broadcast(List<Mytoken> tokens,int command)
        {
            Broadcast(tokens, Logic_Area, command);
        }
        public void Broadcast(List<Mytoken> tokens,int area,int command)
        {
            Broadcast(tokens, area, command, null);
        }
        public void Broadcast(List<Mytoken> tokens,int area,int command,object message)
        {
            Broadcast(tokens, new TransModel(Logic_Type, area, command, message));
        }
        public void Broadcast(List<Mytoken> tokens, TransModel model)
        {
            foreach (Mytoken token in tokens)
            {
                Send(token, model);
            }
        }
    }
}
